/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Controladores;
import Clases.Unidad;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;

/**
 *
 * @author Bryan
 */
public class UnidadPersonalizada extends UnidadJpaController {

    public UnidadPersonalizada(EntityManagerFactory emf)
    {
        super(emf);
    }

    public Short GenerarId(){
        List<Unidad> todos = this.findUnidadEntities();
        if(todos.isEmpty()){
            return 0;
        }
        else{
            return Short.valueOf(String.valueOf(todos.size()));
        }
    }

}
